Print66 is a utility that implements the Berkeley Line Printer Protocols on the Macintosh. It normally spools files sent from a remote host (for instance an Unix machine) and sends them to a LaserWriter on the Mac network, a Serial printer or an USB printer. It can also be used to print any file to a Laserwriter printer.
Print66 should run under System 7 and requires MacTCP or OpenTransport TCP/IP.
This program is really a quick and dirty work, which in many aspects does not conform to Macintosh user interface, but I may rework it if I have enough time and/or someone find it useful. Bug reports and suggestions are welcomed at barijaona@geocities.com.
This program is freeware and will stay freeware. As the program is free, it comes without any warranty. You use it at your own risks.
Setting Up Print66 as server on a Macintosh
Print66 looks for a folder called "Spool Folder" in your system folder and a text file called LPD.config in the "Spool Folder" folder. A sample LPD.config file is included in this package. The sample contains detailed information about setting up for your installation.
For a quick setting :
• in the file LPD.config in the "Spool Folder", edit the PRINTER section and HOST section to define which printers are connected and which remote computers are allowed to print.
For instance :
PRINTER pslaser PAP "Laserjet 5" POSTSCRIPT
PRINTER raw1 SERIAL "Printer port" 57600 10 N 8 XON # a printer connected using PowerPrint™ serial to parallel cable
PRINTER raw2 USB "Stylus Photo 750:Stylus Photo 750"
HOST 192.168.1.5
HOST s2345678.acme.com
• copy the "Spool Folder" into your system folder.
Important Note : If you used serial printers with a version of Print66 prior a 0.5, you will have to modify the LPD.config file. See explanations in the sample file.
Known issue : with my Epson Stylus Photo 750 and my G4 Cube under MacOS 9.0.4, after a cold start, it seems that you have to print something using Epson's driver before Print66 and other applications addressing directly the USB port achieve to send data. It seems to be a hardware issue, as there is no problem after a warm reboot. If you encounter something similar, please let me know.
What's in the LogFile
The log file keeps a record of everything printed through the spooler as well as all errors. This file can be cleared by using the "Clear Log File" entry under the "File" menu.
If you are experiencing problems you may want to turn debugging on by adding a DEBUG command to the config file. This causes extra debugging information to be sent to the log file.
The log file may be cleared using the "Clear Log File" entry in the file menu. When this is done the contents are first mailed to the ADMIN specified in the config file.
What if I Send a non-PostScript file to a PostScript printer
The program checks the first 2 characters in the file looking for %! which it would assume to be in all postscript file. If these two characters are not there, Print66 will reject the file and mail the owner.
What to do on an Unix box to set it up as a print client
//Based on information's provided by Casper Boon//
The Unix machine needs to be told about the printer. This is done by adding an entry to the printcap file. The following shows such an entry :
pslaser|PostScript LaserWriter:\
:rp=pslaser:lp=:\
:rm=server-mac:sd=/usr/spool/maclpd:\
:lf=/usr/adm/lpd-errs:
To print to this printer you use the command :
lpr -Ppslaser <filename>
The "rm" entry tells lpr which machine the printer is connected to, in our case where Print66 is running.
The "rp" entry tells lpr which of the printers connected to this rm to print on. This name will be passed on to Print66 which will map the name to a printer as specified in the config file.
The "sd" entry tells the pathname of a spool directory. The "lf" entry tells the log file name.
If your LPD.config file on the Macintosh has an entry :
PRINTER pslaser PAP "" POSTSCRIPT # default
the print command above would print to your default Appletalk Laserwriter printer.
What to do on an IBM AS/400 system to set it up as a print client
The syntax of a print request in the AS/400 is :
LPR RMTSYS(name_of_mac_in_DNS | *INTNETADR )
PRTQ(name_of_mac_queue)
FILE(name_of_as400_printfile)
JOB(job_number/user_name/job_name | *)
SPLNBR(number | *ONLY | *LAST)
MFRTYPMDL(printer_model)
[ INTNETADR(ip_adress) ]
You can specify the Mac host by providing either a name which can be resolved by the AS/400 or an IP numerical address (INTNETADR option).
If you do not specify the job which generated the spool file, the AS/400 assumes it is the current job.
For instance, I use the command :
LPR RMTSYS(BJRMAC) /* Name of my macintosh in our domain */
PRTQ(RAW)
FILE(QSYSPRT) /* or any other print file */
SPLNBR(*LAST)
MFRTYPMDL(*HPII)
If the name of the Macintosh host (here BJRMAC) is defined correctly in your network DNS or in the AS/400's TCP/IP host table, and if there is an entry like the following inside the Config.LPD file on that Macintosh :
PRINTER "RAW" SERIAL "Printer port" 57600 10 N 8
then the print request above should print correctly to a PCL printer (like HP Laserjet) connected to the Printer Port of the Macintosh.
Nota : on these examples, the name RAW is arbitrary, but was chosen because Hewlett-Packard network printers use the same.
If you are to print regularly, you can create on the AS/400 an outqueue object (OUTQ). This can be achieved through a command like this :
CRTOUTQ OUTQ(QGPL/BJRMACLPD) /* name of the OUTQ */
RMTSYS(BJRMAC) /*name of my macintosh in our domain */
RMTPRTQ(RAW) /* name defined on my mac's LPD.config */
AUTOSTRWTR(1) CNNTYPE(*IP) DESTTYPE(*OTHER)
MFRTYPMDL(*WSCSTA4) /* A4 paper format */
WSCST(QWPHPLSR4) /* IBM's driver for the HP Laser 4 */
/* for other printers, look for objects which type is *WSCST */
After that, all you will have to do in order to print is to send your spool files to the created outqueue.
What to do on another Macintosh to set it up as a print client
Nota : Remember that Print66 is a print server. Print formatting is to be achieved by the client.
You can use Apple's LaserWriter 8.5.1 or Later as a LPR postscript client. The Apple package includes a utility named "Desktop Printer Utility" (the name may vary in international versions of MacOS ; for instance, in French MacOS, it is "Utilitaire Service d’impression"). You could then connect an old postscript printer to a Mac, run Print66 on this machine to add LPR/LPD ability and avoid the use of AppleTalk for the rest of the network.
On the Macintoshes who will request print jobs :
• Launch the Desktop Printer Utility.
• Select "Printer (LPR)" and click OK.
• In the "PostScript Printer Description (PPD) File" section, click on "Change..." and select the PPD for your printer.
• In the "Internet Printer" section, click on "Change...".
• Enter the IP address or domain name of the Mac which runs Print66 for "Printer Address".
• Enter the queue name as specified in the PRINTER line in the LPD.config file on the Mac where Print66 runs.
• Go to the File menu and select "Save". Enter a name and location for the desktop printer icon and click OK. The default name is the printer's IP address, and the default location is on the desktop.
• Quit.
Nota :
• Info based on Apple's TIL article 24409
What to do on a Windoze system to set it up as a print client
Windows NT and Windows 98 support LPR printing. It is not included in the default OS install : you will have to explicitly install a service named Microsoft TCP/IP printing.
For Windows95, you will have to use a third party software, for instance Axis Print Monitor for Windows that I found at <http://www.axis.com/techsup/software/>.
I have checked that these solutions work, but you will have to read the documentation, because my doctor warned me not to spend a long time dealing with stuff related to a certain monopoly because it tends to make me horribly angry :-)
Version History
The latest version can be downloaded through the URL : <http://homepage.mac.com/barijaona/download/print66_folder.sit>
Print66 is a quick port from the lpDaemon program originally written by Casper Boon in Think C. The lpDaemon version 3.3.2 sources have been ported to Metrowerks CodeWarrior environment and have been recompiled. Some parts of the code have been rewritten due to the change of environment and the evolutions of Mac Headers, and to build a PowerPC version. I corrected a few bugs (and may have inadvertently added new ones :-) ), added the handshake support for serial printers and the support of USB printers.
I did this work because I wanted to print some AS/400 print files on a printer connected directly to my desktop Macintosh. The possibility to print to a serial port or USB printer appears nowadays more interesting than the use of AppleTalk, because many modern network printers already handle directly TCP/IP and LPR/LPD, and this explain the focus of my work.
• 0.68 (Jan, 11th 2002) : workaround a problem where long host names made the spool names get longer than the 31 characters the classic MacOS can handle.
• 0.67 : internal version.
• 0.66 (Sep, 5th 2001) : this version should run faster (better buffer handling) ; the Laserwriter printer driver is now opened in read only mode, which solves some issue on getting the resources and is safer anyway.
• 0.65 (June, 4th 2001) : solves a problem poking spool files under MacOS 9.1 ; this version should also run faster.
• 0.64 (Dec, 4th 2000) : solves another problem with the null byte marking the end of a data or control file. In certain situations, remote hosts using Apple Laserwriter driver could not print.
• 0.63 (Nov, 28 th 2000) : improves the way Print66 handles the null byte marking the end of a data or control file, and acknowledges it. The previous method was not 100% compliant with RFC1179 and could cause problems with certain clients or under certain network conditions. Added a FAQ to the documentation.
• 0.62 (Nov, 24 th 2000) : (was only sent to some testers) attempt to correct the way Print66 handles the null byte marking the end of a spool file and acknowledges it.
• 0.61 (Oct, 18 th 2000) : workaround for the LMGetUnitTableEntryCount missing in InterfaceLib in early PowerPC machines ROMs.
• 0.6 (Oct, 2nd 2000) : added USB printer support, and corrected some bugs.
• 0.5 (Aug, 14th 2000) : corrected a long standing crash for 68K machines ; added handshaking support for serial ports (either RTS/CTS or Xon/Xoff) ; requires use of explicit ports names for defining serial printers in the LPD.config file ; added support for Quit AppleEvent ; cleaned source from some pre-system 7 routines and adapted it to UniversalHeaders 3.3.2. The spectacular leap in version numbering is due to mistakes :-). Tested under MacOS 8.6 and MacOS 7.1.
• 0.0.4 (Jul, 14th 2000) : corrected the mailing routine ; bugs correction and clarification in log file.
• 0.0.3 (Jul, 11th 2000) : fixed a bug related to closing serial ports (already fixed in 0.0.2, but this version was never published). Reviewed the documentation and the default config file. Tested under MacOS 8.6.
• 0.0.2 (Jun, 30th 2000) : internal version.
• 0.0.1 (Jun, 20th 2000) : first version.
To do (for hypothetical future versions, if someone is interested...)
- Add an AUTOCLEARLOG option,
- Review the interface which seems so 20th century... or pre-MacOS X unix... The idea is to make Print66 a faceless application and to have another app for setup.
- Improve interaction with other programs like MacGSView to enable for instance the generation of PDF files.
The Legal Stuff (too bad this world requires me to state that...)
The program is provided "as is" and without warranty, express and implied, including but not limited to any implied warranties of merchantability and fitness for a particular purpose. In no event will Barijaona Ramaholimihaso be liable for any damages, including lost profits, lost savings, or other incidental or consequential damages, even if Barijaona Ramaholimihaso is advised of the possibility of such damages, or for any claim by you or any third party.
If you do not agree with the above terms, simply do not use the program, or consider using an alternative program such as :
• lpDaemon, the program from which Print66 is closely derived. lpDaemon can be found in InfoMac archives or HyperArchive, for instance at the URL <ftp://mirrors.aol.com/pub/info-mac/comm/inet/lp-daemon-34.hqx>,
• the commercial package IntragyAccess from Lucent Technology. Information about it can be found at <http://www.lucent.com/ins/products/maxtnt/intragyaccess.html>.
For programmers : As Casper Boon who posted the original program source in 1993, I decided to make the source public, because it seems to interest more people than I thought, and this is the best guarantee I can provide to the Mac community that a cheap ;-)) solution to the issue I faced will remain. I hope you will give me a feedback. For copyright issues, you can probably use the sources to start other projects as soon as they remain freeware, but for commercial projects, you'd better contact Casper Boon because he has at least some moral rights on it. As for me, there is no problem whatever your project is, as far as you mention me in the About dialog box of your program. I am also interested to see how people use the source and would appreciate receiving copies of applications created with it, but this is not a requirement.
All products mentioned are trademarks or registered trademarks of their respective holders. Many parts of the code are work of Casper Boon who holds their original copyright.
Information presented here is accurate as of the time of writing, but is subject to change without notice.
"Whatever you do will be insignificant, but it is very important that you do it." --Mahatma Gandhi.